<template>
 <div class="sidebar">
   <h2>侧边栏</h2>
   <ul>
     <li v-for="item in items" :key="item.id">
       <router-link :to="item.path">{{ item.name }}</router-link>
     </li>
   </ul>
 </div>
</template>

<script>
export default {
 name: 'sidebar',
 data() {
   return {
     items: [
       { id: 1, name: '个人信息', path: '/me' },
       { id: 2, name: '在线聊天', path: '/blog' },
       { id: 3, name: '交友系统', path: '/contact' }
     ]
   }
 }
}
</script>

<style scoped>
.sidebar {
 width: 200px;
 background-color: #f5f5f5;
 padding: 20px;
}
</style>
